package com.cntcdt.api.db.model.base;

import java.io.Serializable;
import java.sql.ResultSet;
import java.util.Date;

/**
 * 这是money_operate的数据传输对象基类,直接与表对应<br>
 */
public abstract class MoneyOperateModelBase  implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 属性:id<br>
     */
    private Integer id = 0;
    /**
     * 属性:money<br>
     */
    private Double money = 0.0;
    /**
     * 属性:addTime<br>
     */
    private Date addTime = new Date();
    /**
     * 属性:updateTime<br>
     */
    private Date updateTime = new Date();
    /**
     * 属性:operate<br>
     */
    private String operate = "";
    /**
     * 属性:userId<br>
     */
    private Integer userId = 0;
    /**
     * 属性:presentMoney<br>
     */
    private Double presentMoney = 0.0;
    /**
     * 属性:isNotSearch<br>
     */
    private Integer isNotSearch = 0;
    /**
     * 属性:押金<br>
     * 含义:押金<br>
     */
    private Double preMoney = 0.0;

    /**
     *  默认构造方法,构造一个默认的MoneyOperateModelBase对象
     */
    public MoneyOperateModelBase(){
    }

    /**
     *  构造函数
     *  @param rs 数据库查询结果集
     */
    public MoneyOperateModelBase(ResultSet rs){
           try{
               this.id = rs.getInt("id");
               this.money = rs.getDouble("money");
               this.addTime = rs.getDate("addTime");
               this.updateTime = rs.getDate("updateTime");
               this.operate = rs.getString("operate");
               this.userId = rs.getInt("userId");
               this.presentMoney = rs.getDouble("presentMoney");
               this.isNotSearch = rs.getInt("isNotSearch");
               this.preMoney = rs.getDouble("preMoney");
           }catch(Exception e) {
              e.printStackTrace(); 
           }
    }


    /**
     * 设置属性id<br>
     * @param id 待设置的属性id的值
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取属性id<br>
     * @return 属性id的值
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置属性money<br>
     * @param money 待设置的属性money的值
     */
    public void setMoney(Double money) {
        this.money = money;
    }

    /**
     * 获取属性money<br>
     * @return 属性money的值
     */
    public Double getMoney() {
        return money;
    }

    /**
     * 设置属性addTime<br>
     * @param addTime 待设置的属性addTime的值
     */
    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    /**
     * 获取属性addTime<br>
     * @return 属性addTime的值
     */
    public Date getAddTime() {
        return addTime;
    }

    /**
     * 设置属性updateTime<br>
     * @param updateTime 待设置的属性updateTime的值
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * 获取属性updateTime<br>
     * @return 属性updateTime的值
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置属性operate<br>
     * @param operate 待设置的属性operate的值
     */
    public void setOperate(String operate) {
        this.operate = operate;
    }

    /**
     * 获取属性operate<br>
     * @return 属性operate的值
     */
    public String getOperate() {
        return operate;
    }

    /**
     * 设置属性userId<br>
     * @param userId 待设置的属性userId的值
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取属性userId<br>
     * @return 属性userId的值
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置属性presentMoney<br>
     * @param presentMoney 待设置的属性presentMoney的值
     */
    public void setPresentMoney(Double presentMoney) {
        this.presentMoney = presentMoney;
    }

    /**
     * 获取属性presentMoney<br>
     * @return 属性presentMoney的值
     */
    public Double getPresentMoney() {
        return presentMoney;
    }

    /**
     * 设置属性isNotSearch<br>
     * @param isNotSearch 待设置的属性isNotSearch的值
     */
    public void setIsNotSearch(Integer isNotSearch) {
        this.isNotSearch = isNotSearch;
    }

    /**
     * 获取属性isNotSearch<br>
     * @return 属性isNotSearch的值
     */
    public Integer getIsNotSearch() {
        return isNotSearch;
    }

    /**
     * 设置属性押金<br>
     * 含义:押金<br>
     * @param preMoney 待设置的属性押金的值
     */
    public void setPreMoney(Double preMoney) {
        this.preMoney = preMoney;
    }

    /**
     * 获取属性押金<br>
     * 含义:押金<br>
     * @return 属性押金的值
     */
    public Double getPreMoney() {
        return preMoney;
    }


    /**
     * 比较两个对象在逻辑上是否相等
     * @see java.lang.Object#equals(java.lang.Object)
     */
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof MoneyOperateModelBase)) {
            return false;
        }

        final MoneyOperateModelBase otherModel = (MoneyOperateModelBase) other;
        if (getId()!=null && !getId().equals(otherModel.getId())) {
            return false;
        }
        return true;
    }

    /**
     * 根据主键生成HashCode
     * @see java.lang.Object#hashCode()
     */
    public int hashCode() {
        StringBuffer buffer = new StringBuffer();
        buffer.append('|').append(id);
        return buffer.toString().hashCode();
    }
}
